package com.eascs.demand.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.eascs.admin.common.dao.BaseO2oDao;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.demand.entity.UserDemandApplyComment;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class DemandApplyCommentService extends BaseO2oDao{
	private static Logger log = LoggerFactory.getLogger(DemandApplyCommentService.class);

	@Transactional(transactionManager = "o2oTransactionManager")
	public void insertComment(UserDemandApplyComment comment){
		this.insert(comment);
	}

	public List<UserDemandApplyComment> getCommentViewListByTicketId(String billCode) {
		return this.findEntitys(
				"select tc.bill_code, tc.comment_content,tc.status,tc.creator,tc.create_date, " +
						" tc.updator,tc.update_date, tc.creator_name, tc.updator_name " +
						" from user_demand_apply_comment tc where tc.bill_code=? order by tc.create_date",
				UserDemandApplyComment.class, billCode);
	}
}
